package com.example.springbootwebsocket.controller;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: Wangcc
 * @Date: 2019/9/29 14:54
 * @Description:
 */
@RestController
public class HelloController {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @RequestMapping("/send")
    public void SennerMsg(String msg){
        amqpTemplate.convertAndSend("exchange","a",msg);
    }
}
